module.exports = (sequelize, DataTypes) => {
  const Travel = sequelize.define(
    "Travel",
    {
      //定义模型属性
      travelId: {
        type: DataTypes.INTEGER(10),
        autoIncrement: true,
        primaryKey: true,
      },
      name: {
        type: DataTypes.STRING(20),
        allowNull: false,
      },
      desc: {
        type: DataTypes.STRING(200),
        allowNull: true,
      },
      category: {
        type: DataTypes.INTEGER(1),
        allowNull: false,
      },
      content: {
        type: DataTypes.STRING(1000),
        allowNull: true,
      },
      logo: {
        type: DataTypes.STRING(255),
        allowNull: true,
      },
    },
    {
      tableName: "travels",
    }
  );
  return Travel;
};
